<header class="clearfix">
    <div class="top-header">
        <div class="wrapper">
            <a href="{{url('')}}" id="logo"><img  src="{{url('public/img/logo.png')}}"></a>
            {% if (dispatcher.getActionName() == 'index' and dispatcher.getControllerName() == 'index') %}
            {{form('search','id':'searchForm','class':'searchForm')}}
            {% else %}
            {{form('id':'searchForm','class':'searchForm')}}
            {% endif %}
            <p class="search">
                <input type="text" name="text_search" class="osearch" value="{{text_search}}">
                <input type="hidden" name="page" id="page" value="{{page}}"/>
                <input type="hidden" name="limit" id="limit" value="{{limit}}"/>
                <input type="hidden" name="orderby" id="orderby" value="{{orderby}}"/>
                <input type="submit" value="" class="btnsearch">
            </p>
            {{endform()}}

            {% if auth %}
            <a href="{{url('logout')}}" class="dk">Đăng xuất</a><p class="dk">&nbsp;/ &nbsp;</p><a href="{{url('profile')}}" class="dk" title="Quản lý tài khoản">Hi, {{auth.getName()}}</a>
            {% else %}
            <a href="{{url('signup')}}" class="dk"> Đăng ký</a> <p class="dk">&nbsp;/ &nbsp;</p><a href="{{url(loginparam)}}" class="dk">Đăng nhập</a>
            {% endif %}
            <a href="{{url('upload')}}" style="float:right;margin-top: -20px;margin-right: 10px"><img src="{{url('public/img/upload.png')}}"></a>;		
        </div>
    </div>
    <div class="menu" id="menu">
        <nav class="wrapper">
            <ul id="nav" class="sf-menu">
                <li class="current-menu-item">
                    <a href="{{url('')}}" title="Trang chủ">
                        <img src="{{url('public/img/logo-home.jpg')}}" style="margin-top:10px">
                    </a>
                </li>
                {% for type in menu %}
                <li><a href="{{url('type/search/'~type['id'])}}">{{type['name']}}</a>
                    <ul>
                        {% for topic in type['topics'] %}
                        <li><a href="{{url('topic/search/'~topic['id'])}}">{{topic['name']}}</a></li>
                        {% endfor %}				
                    </ul>
                </li>
                {% endfor %}
                <li><a href="{{url('user_guide')}}">Hướng Dẫn</a>
                    <ul>
                        <li><a href="{{url('user_guide')}}">Sử dụng</a></li>
                        <li><a href="{{url('money')}}">Nạp tiền</a></li>
                    </ul>
                </li>
                <li><a href="{{url('contact')}}">Liên hệ</a></li>
            </ul>
            <div id="combo-holder"></div>
        </nav>
    </div>
</header>
